#ifndef _WEB_SERVLET_H
#define _WEB_SERVLET_H
#include "IWeb.h"
#include "TinyHttp.h"
class WebServlet : public IWeb
{
private:
    /* data */
public:
    void start();
    void onLoad(INode *node);
    WebServlet(/* args */);
    ~WebServlet();
    TinyHttpPackage package;
    void onMessage(ISession *session,const void *data,int len);
    void _handleWebContent(ISession *session);
public:
    virtual void onGet(IRequest *request,IResponse *response) = 0;
    virtual void onPost(IRequest *request,IResponse *response) = 0 ;
    virtual void on(REQUEST_TYPE type,std::function<void(IRequest*,IResponse*)> handle) = 0;
};

#endif // _WEB_SERVLET_H